import { baseUrl, khglUrl, dicUrl } from '@/config/env'
import request from '@/router/axios'
import { userInfo, tableData } from '@/mock/user'
import { menu, menuAll } from '@/mock/menu'
export const loginByUsername = (username, password, code, randomStr) => {
    var grant_type = 'password'
    var scope = 'server'
    return request({
        url: '/auth/oauth/token',
        headers: {
            'Authorization': 'Basic cGlnOnBpZw=='
        },
        method: 'post',
        params: { username, password, randomStr, code, grant_type, scope }
    })
}

export const getUserInfo = () => {
    return request({
        url: '/admin/user/info',
        method: 'get'
    })
}

export const logout = (accesstoken, refreshToken) => {
    return request({
        url: '/auth/removeToken',
        method: 'post',
        params: { accesstoken, refreshToken }
    })
}



